package cn.iocoder.yudao.module.energy.controller.admin.alert.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 预警新增/修改 Request VO")
@Data
public class AlertSaveReqVO {

    @Schema(description = "预警ID", example = "1024")
    private Long id;

    @Schema(description = "设备ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12345")
    @NotEmpty(message = "设备ID不能为空")
    private String deviceId;

    @Schema(description = "预警类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "OVER_VOLTAGE")
    @NotEmpty(message = "预警类型不能为空")
    private String alertType;

    @Schema(description = "实际值", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "实际值不能为空")
    private BigDecimal alertValue;

    @Schema(description = "阈值", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "阈值不能为空")
    private BigDecimal threshold;

    @Schema(description = "预警时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "预警时间不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime alertTime;

    @Schema(description = "预警信息")
    private String message;

    @Schema(description = "处理状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "PENDING")
    @NotEmpty(message = "处理状态不能为空")
    private String status;

    @Schema(description = "告警级别", requiredMode = Schema.RequiredMode.REQUIRED, example = "warning")
    @NotEmpty(message = "告警级别不能为空")
    private String level;

} 